<?php



namespace App\Http\Requests\Company;


use App\Rules\NoSensitiveWord;
use Illuminate\Support\Facades\Auth;

class CompanyProcessRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => ['required',new NoSensitiveWord],
        ];
    }

    public function messages()
    {
        return [
            'title.required' => __('请输入流程名'),
            'description.required' => __('请输入简单描述'),
        ];
    }

    public function filldata()
    {

        $user = Auth::user();
        return [
            'company_id'=>$user['login_company_id'],
            'title'=>$this->input('title'),
            'description' => $this->input('description')
        ];
    }
}
